package com.javaee.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    private int id;
    private String phone;
    private String pwd;
    private String name;
    private String sex;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate birthday;

    private String address;
    private String cno;
    private MultipartFile fileName;//头像文件，用于上传oss
    private String tx;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;
    private String role;
    private double balance;

    public User(int id, String phone, String pwd, String name, String sex, String address, String cno, String tx, String role, double balance) {
        this.id = id;
        this.phone = phone;
        this.pwd = pwd;
        this.name = name;
        this.sex = sex;
        this.address = address;
        this.cno = cno;
        this.tx = tx;
        this.role = role;
        this.balance = balance;
    }
}
